Assembly Language
© Copyright Brian Brown, 1988-2000. All rights reserved.
| Notes | Home Page |


16-32 BIT MICROPROCESSORS
home page prev page

This module is the individual work of Brian Brown. It may not be copied or used in any form without his permission.


80x86 Instruction Sets
An instruction set is a group of instructions recognised by the processor

Instruction sets are subdivided into a number of groups


Data Transfer Instructions
These move data between memory and processor registers


	mov ax, 0700h ; immediate data to register
	mov cx, bx ; register to register
	mov ax, [200] ; move memory contents to register
	mov [bx], ax ; move register to memory

In the above diagram, the instruction MOV AX, BX will affect the AX, and IP registers. IP will point to the next instruction once it has executed then MOV AX, BX (the address of the next instruction will be 102E.


Arithmetic Instructions
These perform calculations on data


	add ax, 0700h ; add register with immediate data
	inc cx ; add one to register
	inc word ptr [200] ; increment memory contents
	sub ax, [bx] ; subtract memory contents from register
	mul bx ; multiply ax and bx together


Logical Instructions
These perform boolean operations on individual bits


	and ax, 0700h ; logical and immediate data to register
	or cx, [bx] ; logical or register with memory contents
	shl ax, 2 ; rotate left bits in ax register
	xor bx, ax ; logical exclusive or register with register


String Instructions
These manipulate strings, scan, copy, move, compare


	rep movsb ; move from ds:si to es:di until cx is zero
	movsw ; move ds:si to es:di for number of bytes in cx
	scas b ; scan string at ds:si for character in al


Program Flow Control Instructions
These alter sequential flow of programs


	conditional (use flags) or unconditional
	implement HLL constructs, if then, while, for next
	
	jmp 0004 ; unconditional jmp to memory location
	jmp far f000:0978
	jge 0900 ; conditional jump greater or equal
	jnz 0376 ; conditional jump if z flag is zero
	jc 0100 ; jump if carry is set to cs:0100


home page prev page

Copyright Brian Brown, 1991-2000, All rights reserved.